package borge.web.teamspirit.client.data;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import borge.web.teamspirit.client.interfaces.PersistentData;

/**
 * A League division is basically a serie.
 * A number of teams belong to the division
 * and each team can have a LeagueSerie instance
 * that is mapped to an instance of this class.
 * 
 * @author Andreas Borglin
 *
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class LeagueDivision implements PersistentData {

	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String iEncodedKey;	
	
	@Persistent
	private String iLeagueKey;
	
	//@Persistent
	//private String iLeagueId;
	
	// Like 1,2,3,4
	@Persistent
	private String iDivision;
	
	// Like a, b,c ,d
	@Persistent
	private String iSubDivision;
	
	// List of registered teams registered in this division
	//@Persistent
	//private String iTeamsKeys;
	
	// what about table urls and stuff?
	// start, end, days, times..
	// do we really want to fill the database with all this..prolly not
	
	@Persistent
	private String iTableUrl;
	
	private Integer iStatus;
	
	
	public LeagueDivision(){
		
	}
	
	public String toString(){
		return iDivision + iSubDivision;
	}
	
	public LeagueDivision(String div, String sub){
		iDivision = div;
		iSubDivision = sub;
	}
	
	public String getEncodedKey(){
		return iEncodedKey;
	}
	
	public void setLeagueKey(String aKey){
		iLeagueKey = aKey;
	}
	
	public String getLeagueKey(){
		return iLeagueKey;
	}
	
	public void setDivision(String aDivision){
		iDivision = aDivision;
	}
	
	public String getDivision(){
		return iDivision;
	}
	
	public void setSubDivision(String aSubDiv){
		iSubDivision = aSubDiv;
	}
	
	public String getSubDivision(){
		return iSubDivision;
	}
	
	@Override
	public String getDisplayingWidget() {
		// TODO Auto-generated method stub
		return null;
	}

	
	
}
